Baselines

Hello,

1- I have a formal module linked to a baseline.

Is it possible to access (Print or copy within an attribute in the formal module) the data of the baseline attributes via the formal module out-going links?

2- When I use the function Compare Baselines, the result I have concerns the absolute numbers and the modifications.

How can I get the PUID of each absolute number?
izzo - Mon Sep 27 08:52:30 EDT 2010

Re: Baselines
izzo - Tue Sep 28 03:40:04 EDT 2010

Module m=current
Module module_gen
string n_mod
string id_gen
Link ll
for o in all m do {
for ll in all (o-> linkModule) do {

cible= target(lien)
module_gen= module(cible)// module_gen is a baseline
nmod=name(module_gen) // module_gen is a baseline
print nmod

Id_gen=cible."PUID-V"
print Id_gen "\n" // no output
}
}
Why I can not print the content of my baseline attributes ?? could it be the fact that my target module is a baseline and not a current module ?

Please Any ideas ?

Thanks

Re: Baselines
Mathias Mamsch - Tue Sep 28 03:51:39 EDT 2010

izzo - Tue Sep 28 03:40:04 EDT 2010
Module m=current
Module module_gen
string n_mod
string id_gen
Link ll
for o in all m do {
for ll in all (o-> linkModule) do {

cible= target(lien)
module_gen= module(cible)// module_gen is a baseline
nmod=name(module_gen) // module_gen is a baseline
print nmod

Id_gen=cible."PUID-V"
print Id_gen "\n" // no output
}
}
Why I can not print the content of my baseline attributes ?? could it be the fact that my target module is a baseline and not a current module ?

Please Any ideas ?

Thanks

To print the attribute values of your link target you need to use the correct functions:
 

Module module (Link L) - gives you the link module for L 
ModuleVersion sourceVersion (Link) - gives you the module version that contains the source of the link
ModuleVersion targetVersion (Link) - gives you the module version that contains the target of the link

 


You should always use the sourceVersion & targetVersion functions, to make sure your script will also work, when links go into baselines. The normal pattern for reading links is:

 

 

 

Link L 
Object o
for L in all (o->"*") do {
   ModuleVersion mvTgt = targetVersion L 
   if (null data mvTgt) load(mvTgt, false) // open the target module
   Object oTgt = target L
   if (null oTgt) { print "Error when handling link ...\nHandle it!"; continue }
   Module mTgt = module oTgt 
   // your code goes below ...
   print "Handling link from " (fullName module o) ":" (identifier o) " --> " (fullName mTgt) ":" (identifier oTgt)
}



Hope this helps, regards, Mathias



 

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Baselines
izzo - Tue Sep 28 05:41:15 EDT 2010

Mathias Mamsch - Tue Sep 28 03:51:39 EDT 2010

To print the attribute values of your link target you need to use the correct functions:
 

Module module (Link L) - gives you the link module for L 
ModuleVersion sourceVersion (Link) - gives you the module version that contains the source of the link
ModuleVersion targetVersion (Link) - gives you the module version that contains the target of the link

 


You should always use the sourceVersion & targetVersion functions, to make sure your script will also work, when links go into baselines. The normal pattern for reading links is:

 

 

 

Link L 
Object o
for L in all (o->"*") do {
   ModuleVersion mvTgt = targetVersion L 
   if (null data mvTgt) load(mvTgt, false) // open the target module
   Object oTgt = target L
   if (null oTgt) { print "Error when handling link ...\nHandle it!"; continue }
   Module mTgt = module oTgt 
   // your code goes below ...
   print "Handling link from " (fullName module o) ":" (identifier o) " --> " (fullName mTgt) ":" (identifier oTgt)
}



Hope this helps, regards, Mathias



 

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Thanks !!

It works

When I compare baselines (File-Baseline-Compare) I have the below output :

Added / Deleted Objects
====================
object #250 only exists in 3.0
object #251 only exists in 3.0
object #252 only exists in 3.0
object #253 only exists in 3.0
object #254 only exists in 3.0
object #255 only exists in 3.0
object #256 only exists in 3.0
object #257 only exists in 3.0
object #258 only exists in 3.0
object #259 only exists in 3.0
object #260 only exists in 3.0

The problem is that the absolute numbers are printed in a window .
Is it possible to scan them and enter them into a 2D Table
The problem is that I want do something automatic that could include all the list inside a table to get the corresponding objects and therefore print the OBJECT TEXT and the PUID from the concerned Baseline.
Thank you

Re: Baselines
Mathias Mamsch - Tue Sep 28 10:07:09 EDT 2010

izzo - Tue Sep 28 05:41:15 EDT 2010
Thanks !!

It works

When I compare baselines (File-Baseline-Compare) I have the below output :

Added / Deleted Objects
====================
object #250 only exists in 3.0
object #251 only exists in 3.0
object #252 only exists in 3.0
object #253 only exists in 3.0
object #254 only exists in 3.0
object #255 only exists in 3.0
object #256 only exists in 3.0
object #257 only exists in 3.0
object #258 only exists in 3.0
object #259 only exists in 3.0
object #260 only exists in 3.0

The problem is that the absolute numbers are printed in a window .
Is it possible to scan them and enter them into a 2D Table
The problem is that I want do something automatic that could include all the list inside a table to get the corresponding objects and therefore print the OBJECT TEXT and the PUID from the concerned Baseline.
Thank you

It is not so hard to compare the objects with a baseline. You should do your own routine:
 

Skip skBaseline = createString()
Skip skModule   = createString()
Object obj; 
Module modBaseline = null // set me to the baseline
Module theModule   = null // set me to the baseline
for obj in modBaseline do put(skBaseline, obj."Absolute Number" "", obj)
for obj in theModule   do put(skModule  , obj."Absolute Number" "", obj)
 
for obj in skBaseline do if (!find (skModule, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in " (versionString moduleVersion theModule) ".\n"
for obj in skModule   do if (!find (skBaseline, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in current.\n"

 


Hope this gives you the general idea. Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Baselines
izzo - Wed Sep 29 05:26:26 EDT 2010

I tried this. Did not work
-E- DXL: <Line:18> incorrect arguments for (do)
-E- DXL: <Line:19> incorrect arguments for (do)
-I- DXL: all done with 2 errors and 0 warnings
Module m=current

Object obj

Skip skBaseline = createString()
Skip skModule = createString()
Baseline modBaseline=baseline(1,0,null) // set me to the baseline
Baseline theBaseline=baseline(2,0,null) // set me to the baseline

for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",*obj*) //line 18
for obj in theBaseline do put(skModule, obj."Absolute Number" "",*obj*) //line 19, NO need to specify the position of the element ?

for obj in skBaseline do if (!find (skModule, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in " (versionString moduleVersion theModule) ".\n"
for obj in skModule do if (!find (skBaseline, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in current.\n"
Thank you

Re: Baselines
izzo - Wed Sep 29 05:27:20 EDT 2010

The code did not work

Re: Baselines
Mathias Mamsch - Wed Sep 29 05:45:37 EDT 2010

izzo - Wed Sep 29 05:26:26 EDT 2010
I tried this. Did not work
-E- DXL: <Line:18> incorrect arguments for (do)
-E- DXL: <Line:19> incorrect arguments for (do)
-I- DXL: all done with 2 errors and 0 warnings
Module m=current

Object obj

Skip skBaseline = createString()
Skip skModule = createString()
Baseline modBaseline=baseline(1,0,null) // set me to the baseline
Baseline theBaseline=baseline(2,0,null) // set me to the baseline

for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",*obj*) //line 18
for obj in theBaseline do put(skModule, obj."Absolute Number" "",*obj*) //line 19, NO need to specify the position of the element ?

for obj in skBaseline do if (!find (skModule, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in " (versionString moduleVersion theModule) ".\n"
for obj in skModule do if (!find (skBaseline, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in current.\n"
Thank you

Yeah I did not take the time to syntactically correct the code, I thought it might give you the idea about how to determine deleted objects in a baseline. You need to set the Module variables to real modules (e.g. the current and a baseline).

I admit there were a lot of errors in there, here is the corrected (and tested :-) ) code.

Regards, Mathias
 

Module m=current
 
Object obj
 
Skip skBaseline = createString()
Skip skModule = createString()
 
Module modBaseline=load(m, baseline(1,0,null), true) 
 
if (null modBaseline) error "Baseline 1.0 was not found in module!"
 
for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj)
for obj in m do put(skModule, obj."Absolute Number" "",obj)
 
Object obj2
for obj in skBaseline do {
    if (!find (skModule, (key skBaseline) string, obj2)) {
        print "Object " ((key skBaseline) string)  " was purged in current.\n"
    } else {
        if (isDeleted obj && !isDeleted obj2) print "Object " (identifier obj) " was undeleted!"
        if (!isDeleted obj && isDeleted obj2) print "Object " (identifier obj) " was deleted!"
    }
}
 
for obj in skModule do 
    if (!find (skBaseline, (key skModule) string)) 
        print "Object " ((key skModule) string)  " was created in current.\n"

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Baselines
PDU - Wed Sep 29 08:37:43 EDT 2010

izzo - Wed Sep 29 05:27:20 EDT 2010
The code did not work

Hi,

Mathias'code works fine (thanks Mathias).

But it define at the beginning the baseline reference :
 

Module modBaseline=load(m, baseline(1,0,null), true)

 


If your module has not a baseline 1.0 with no suffix ,
you have run time error :

 

 

if (null modBaseline) error "Baseline 1.0 was not found in module!"



You need only modify this line :



 

 

Module modBaseline=load(m, baseline(1,0,null), true)



Pierre



 

Re: Baselines
izzo - Wed Sep 29 09:42:20 EDT 2010

Danke ! it works

1- I did some modifications and I do not really understand why I got such an error, I just did Like it is writen in the DXL manuel. Object object( abso, module if not current module) I have 2 baselines here.
2- Is there something or an attribute that i can rely on to find out if the object Text has changed btw 2 Baselines.

Thanks Again

E- DXL: <Line:25> incorrect arguments for function (object)
-E- DXL: <Line:41> incorrect arguments for function (object)
-I- DXL: all done with 2 errors and 0 warnings
Module m=current

Object obj
Object obj_v1,obj_v2
string PUID_v1,PIUD_v2
Skip skBaseline = createString()
Skip skModule = createString()

Module modBaseline=load(m, baseline(1,0,null), true)
Module theBaseline=load(m,baseline(2,0,null),true)
if (null modBaseline) error "Baseline 1.0 was not found in module!"
if (null theBaseline) error "Baseline 2.0 was not found in module!"
for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj)
for obj in theBaseline do put(skModule, obj."Absolute Number" "",obj)

Object obj2
for obj in skBaseline do {
if (!find (skModule, (key skBaseline) string, obj2)) {
string abso=(key skBaseline) string
print abso "\n"
obj_v1=object(abso,modBaseline)// Doesnt work ? Line 25 incorrect arguments for function (object) weird

PUID_v1=obj_v1."PUID"
print PUID_v1"\n"

print "Object " ((key skBaseline) string) " from baseline v 1 was purged in Baseline 2.\n"
} else {
if (isDeleted obj && !isDeleted obj2) print "Object " (identifier obj) " was undeleted!"
if (!isDeleted obj && isDeleted obj2) print "Object " (identifier obj) " was deleted!"
}
}

for obj in skModule do {
if (!find (skBaseline, (key skModule) string)) {
string abso_1=(key skModule) string
print abso_1 "\n"
obj_v2=object(abso_1,theBaseline)
PUID_v2=obj_v2."PUID"
print PUID_v2 "\n "
print "Object " ((key skModule) string) " was created in Baseline 2.\n"
}
}

Re: Baselines
Mathias Mamsch - Wed Sep 29 10:48:04 EDT 2010

izzo - Wed Sep 29 09:42:20 EDT 2010
Danke ! it works

1- I did some modifications and I do not really understand why I got such an error, I just did Like it is writen in the DXL manuel. Object object( abso, module if not current module) I have 2 baselines here.
2- Is there something or an attribute that i can rely on to find out if the object Text has changed btw 2 Baselines.

Thanks Again

E- DXL: <Line:25> incorrect arguments for function (object)
-E- DXL: <Line:41> incorrect arguments for function (object)
-I- DXL: all done with 2 errors and 0 warnings
Module m=current

Object obj
Object obj_v1,obj_v2
string PUID_v1,PIUD_v2
Skip skBaseline = createString()
Skip skModule = createString()

Module modBaseline=load(m, baseline(1,0,null), true)
Module theBaseline=load(m,baseline(2,0,null),true)
if (null modBaseline) error "Baseline 1.0 was not found in module!"
if (null theBaseline) error "Baseline 2.0 was not found in module!"
for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj)
for obj in theBaseline do put(skModule, obj."Absolute Number" "",obj)

Object obj2
for obj in skBaseline do {
if (!find (skModule, (key skBaseline) string, obj2)) {
string abso=(key skBaseline) string
print abso "\n"
obj_v1=object(abso,modBaseline)// Doesnt work ? Line 25 incorrect arguments for function (object) weird

PUID_v1=obj_v1."PUID"
print PUID_v1"\n"

print "Object " ((key skBaseline) string) " from baseline v 1 was purged in Baseline 2.\n"
} else {
if (isDeleted obj && !isDeleted obj2) print "Object " (identifier obj) " was undeleted!"
if (!isDeleted obj && isDeleted obj2) print "Object " (identifier obj) " was deleted!"
}
}

for obj in skModule do {
if (!find (skBaseline, (key skModule) string)) {
string abso_1=(key skModule) string
print abso_1 "\n"
obj_v2=object(abso_1,theBaseline)
PUID_v2=obj_v2."PUID"
print PUID_v2 "\n "
print "Object " ((key skModule) string) " was created in Baseline 2.\n"
}
}

Nope you did not do exactly like in the manual :-)

Object object ( int nr, Module m )

wants to have an integer not a string. Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Baselines
izzo - Wed Sep 29 10:53:06 EDT 2010

oh Yeah !! I agree :)
Thanks a lot

Re: Baselines
izzo - Thu Sep 30 08:26:47 EDT 2010

Hi Mat

I combined your advice of this morning with yesterday code: It looks correct

But I got this

<Line:68> key used outside SkipList do loop
-R-E- DXL: <Line:69> null intOf string parameter was passed

How can I get my 2nd Skip list elements ?

I tried to a 2nd loop but it did not work. It took a long time and Doors stopped 2
DB db = create "Show diff"
DBE textbox = richText(db, "Text Modification", "", 200, 200, true)
Buffer buff1 = create()
Buffer buff2 = create()
Buffer resBuf = create()
string exigence_Text
Module theBaseline=current

Object obj
Object obj_v1,obj_v2
string PUID_v2

string PUID_v1
Skip skBaseline = createString()
Skip skModule = createString()

Module modBaseline=load(theBaseline,baseline(3,0,null), true)

if (null modBaseline) error "Baseline 3.0 was not found in module!"

for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj)
for obj in theBaseline do put(skModule, obj."Absolute Number" "",obj)
for obj in skModule do {
if (find (skBaseline, (key skModule) string)) {
string abso_1=(key skModule) string
string abso_2=(key skBaseline) string //-R-W- DXL: <Line:68>
obj_v1=object(intOf(abso_2),theBaseline)
obj_v2=object(intOf(abso_1),theModule)
string date1= obj_v2."Last Modified On"
string date2=obj_v1."Last Modified On"
print date1 " " date2 "\n"

PUID_v2=obj_v2."PUID"

if(PUID_v2!=null){
if(date2!=date1) {

buff1=obj_v1."Object Text"
buff2=obj_v2."Object Text"
diff(resBuf, buff1, buff2, "\\cf1\\strike ", "\\cf3\\ul ")

//print "Object " ((key skModule) string) " was created in Baseline 2.\n"

}

}

}

}

Re: Baselines
izzo - Thu Sep 30 08:27:34 EDT 2010

DXL error

Re: Baselines
Mathias Mamsch - Thu Sep 30 09:04:08 EDT 2010

izzo - Thu Sep 30 08:26:47 EDT 2010
Hi Mat

I combined your advice of this morning with yesterday code: It looks correct

But I got this

<Line:68> key used outside SkipList do loop
-R-E- DXL: <Line:69> null intOf string parameter was passed

How can I get my 2nd Skip list elements ?

I tried to a 2nd loop but it did not work. It took a long time and Doors stopped 2
DB db = create "Show diff"
DBE textbox = richText(db, "Text Modification", "", 200, 200, true)
Buffer buff1 = create()
Buffer buff2 = create()
Buffer resBuf = create()
string exigence_Text
Module theBaseline=current

Object obj
Object obj_v1,obj_v2
string PUID_v2

string PUID_v1
Skip skBaseline = createString()
Skip skModule = createString()

Module modBaseline=load(theBaseline,baseline(3,0,null), true)

if (null modBaseline) error "Baseline 3.0 was not found in module!"

for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj)
for obj in theBaseline do put(skModule, obj."Absolute Number" "",obj)
for obj in skModule do {
if (find (skBaseline, (key skModule) string)) {
string abso_1=(key skModule) string
string abso_2=(key skBaseline) string //-R-W- DXL: <Line:68>
obj_v1=object(intOf(abso_2),theBaseline)
obj_v2=object(intOf(abso_1),theModule)
string date1= obj_v2."Last Modified On"
string date2=obj_v1."Last Modified On"
print date1 " " date2 "\n"

PUID_v2=obj_v2."PUID"

if(PUID_v2!=null){
if(date2!=date1) {

buff1=obj_v1."Object Text"
buff2=obj_v2."Object Text"
diff(resBuf, buff1, buff2, "\\cf1\\strike ", "\\cf3\\ul ")

//print "Object " ((key skModule) string) " was created in Baseline 2.\n"

}

}

}

}

Ok first, you should really think about using { C O D E } (without spaces) in your posts to post source. It will highten the chances for people wanting to respond to your posts, since they are much easier to read.

Secondly, you should try to find the reasons for those obvious errors (like syntax errors) yourself. The forum cannot replace a DXL training or studying of the DXL manual. At least try to narrow the reason of the error down, don't just post the complete source code, unless you really see no other option.

At least when you have general DXL questions (like is there a function for XY) because you are writing a script like "Compare Baselines", try asking those questions in one post and do not create a new post for every question.

In my opinion the error message "key used outside SkipList do loop" is pretty obvious to get, when you think about what the key function does. It means you cannot call (key someSkip) when you did not do "for value in someSkip". In your case you want to get the key for skBaseline but iterate over skModule. It seems to me you did not completly get what my example does: It stores the objects of the two modules in two skip lists using "Absolute Number" as a key, and the object as the "Value". So provided you have an object in the baseline (that has the same absolute number as the object in the module), how do you think you will get the object with the same absolute number in the other module?

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Baselines
izzo - Thu Sep 30 09:30:31 EDT 2010

I understood what you meant last time, and the fact that you need to iterate over the list to get the element in that list.

But what I meant in my last post is that I want to get 2 elements, thus 2 absolutes numbers so after I can compare text from differents modules or baselines.

I tried to do 2 consecutive loops and it did not work.

Re: Baselines
izzo - Thu Sep 30 10:42:21 EDT 2010

I got it :)

Re: Baselines
izzo - Fri Oct 01 06:28:34 EDT 2010

Hello,

My script does not print all the Object Texts, it only shows the last element put in the buffers. How can I print all the Objects Texts and their differences ?

Thanks

DB db = create "Show diff"
DBE textbox = richText(db, "Text Modification", "", 200, 200, true)
Buffer exitext = create()
Buffer exittext = create()
Buffer resBuf = create()
for loop {
exitext=obj_v1."Object Text"
exittext=obj_v2."Object Text"
diff(resBuf, exitext,exittext, "\\cf1\\strike ", "\\cf3\\ul ") }
realize db
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
show db
delete resBuf
delete exittext
delete exitext

Re: Baselines
izzo - Fri Oct 01 06:29:11 EDT 2010

//

Re: Baselines
izzo - Fri Oct 01 08:34:48 EDT 2010

izzo - Fri Oct 01 06:28:34 EDT 2010
Hello,

My script does not print all the Object Texts, it only shows the last element put in the buffers. How can I print all the Objects Texts and their differences ?

Thanks

DB db = create "Show diff"
DBE textbox = richText(db, "Text Modification", "", 200, 200, true)
Buffer exitext = create()
Buffer exittext = create()
Buffer resBuf = create()
for loop {
exitext=obj_v1."Object Text"
exittext=obj_v2."Object Text"
diff(resBuf, exitext,exittext, "\\cf1\\strike ", "\\cf3\\ul ") }
realize db
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
show db
delete resBuf
delete exittext
delete exitext

Ok only need to do that

DB db = create "Show diff"
DBE textbox = richText(db, "Text Modification", "", 200, 200, true)
Buffer Buffer1 = create()
Buffer Buffer2 = create()
Buffer resBuf = create()
for loop {
string exitext=obj_v1."Object Text"
string exittext=obj_v2."Object Text"

Buffer1+=exitext
Buffer2+=exittext

diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ") }
realize db
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
show db
delete resBuf
delete Buffer1
delete Buffer2

Re: Baselines
izzo - Mon Oct 04 08:21:16 EDT 2010

Hello

Does anyone know how to link a DBE element as a tab to a textbox ?
I tried what is below: my textbox is not connected to the first Tab
Thanks a lot
string gpChoices[2] = {"test1","test2"}
void fnDoNothingDBE(DBE xDBE) {}
string gpNothing[1] = {"Nothing"}
DB db = create "Show diff"
DBE dbTab = tab(db,gpChoices,2,fnDoNothingDBE)
DBE textbox = richText(db, "", "", 200, 200, true)
textbox->"top"->"inside"->dbTab
textbox->"left"->"inside"->dbTab
textbox->"right"->"inside"->dbTab
textbox->"bottom"->"inside"->dbTab
diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ")
realize db
void fnChooseTab(DBE xTab) {
int i = get(xTab)
if(i==0) {
show(textbox)
} elseif(i==1) {
//show()
}
}
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
set(dbTab,fnChooseTab)
delete resBuf
delete Buffer1
delete Buffer2
show db

Re: Baselines
izzo - Mon Oct 04 08:21:50 EDT 2010

//

Re: Baselines
Mathias Mamsch - Mon Oct 04 15:10:20 EDT 2010

izzo - Mon Oct 04 08:21:16 EDT 2010
Hello

Does anyone know how to link a DBE element as a tab to a textbox ?
I tried what is below: my textbox is not connected to the first Tab
Thanks a lot
string gpChoices[2] = {"test1","test2"}
void fnDoNothingDBE(DBE xDBE) {}
string gpNothing[1] = {"Nothing"}
DB db = create "Show diff"
DBE dbTab = tab(db,gpChoices,2,fnDoNothingDBE)
DBE textbox = richText(db, "", "", 200, 200, true)
textbox->"top"->"inside"->dbTab
textbox->"left"->"inside"->dbTab
textbox->"right"->"inside"->dbTab
textbox->"bottom"->"inside"->dbTab
diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ")
realize db
void fnChooseTab(DBE xTab) {
int i = get(xTab)
if(i==0) {
show(textbox)
} elseif(i==1) {
//show()
}
}
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
set(dbTab,fnChooseTab)
delete resBuf
delete Buffer1
delete Buffer2
show db

You need to manually "hide" and "show" the elements of your GUI that shall appear on each tab. Regards, Mathias
 

// use:{code } ...code...{code }... 
// in your posts to make them formatted like this
// but remove the spaces after 'code'
Buffer Buffer1 = create(); Buffer1 = "Hello this is a test!"
Buffer Buffer2 = create(); Buffer2 = "Hello that was a test!"
Buffer resBuf = create() 
string gpNothing[1] = {"Nothing"}
string gpChoices[2] = {"test1","test2"}
void fnDoNothingDBE(DBE xDBE) { }
 
DB db = create "Show diff"
 
DBE dbTab = tab(db,gpChoices,2,fnDoNothingDBE)
dbTab->"top"->"form"; dbTab->"bottom"->"form"; 
dbTab->"right"->"form"; dbTab->"left"->"form"
 
DBE textbox = richText(db, "", "", 200, 200, true)
textbox->"top"->"inside"->dbTab; textbox->"left"->"inside"->dbTab
textbox->"right"->"inside"->dbTab; textbox->"bottom"->"inside"->dbTab
 
diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ")
 
void fnChooseTab(DBE xTab) {
    int i = get(xTab)
    if(i==0) {
        show(textbox)
    } else if(i==1) {
      hide(textbox)
    }
}
 
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
set(dbTab,fnChooseTab)
delete resBuf
delete Buffer1
delete Buffer2
show db

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Baselines
izzo - Mon Oct 11 03:52:48 EDT 2010

Hello

I have a Dialog Box interface who takes baselines and modules as input parameters.
The first time I click on the button to call my function, I do not have any error.
If I click a 2nd time on the button, I have errors such null Object parameter was passed into argument position 1.
When I close my dialog box and execute the code again I do not have any errors.

Please any ideas ?

Re: Baselines
Mathias Mamsch - Mon Oct 11 06:55:34 EDT 2010

izzo - Mon Oct 11 03:52:48 EDT 2010
Hello

I have a Dialog Box interface who takes baselines and modules as input parameters.
The first time I click on the button to call my function, I do not have any error.
If I click a 2nd time on the button, I have errors such null Object parameter was passed into argument position 1.
When I close my dialog box and execute the code again I do not have any errors.

Please any ideas ?

Just a guess, maybe one of the objects or modules you pass is the current Object/Module? Object and Module Handles will become invalid, when you close the module they are contained in. The current Object / Module changes frequently, for example when opening any module from code. A good way to go about this, is:

// do this at the beginning of your code
Module mCur = current
Object oCur = current

 


Then comment out every call to close (Module) and replace all occurences of 'current' by mCur or oCur. See if it helps.

Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Baselines
izzo - Wed Oct 13 08:54:30 EDT 2010

Mathias Mamsch - Mon Oct 11 06:55:34 EDT 2010

Just a guess, maybe one of the objects or modules you pass is the current Object/Module? Object and Module Handles will become invalid, when you close the module they are contained in. The current Object / Module changes frequently, for example when opening any module from code. A good way to go about this, is:

// do this at the beginning of your code
Module mCur = current
Object oCur = current

 


Then comment out every call to close (Module) and replace all occurences of 'current' by mCur or oCur. See if it helps.

Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Hello Mat

1)I tried, but it did not work.. I closed all the none-current modules who were open at the end of the code. But it did not change anything. So I always have the same problem, I need to close the input dialog box.

2) I aslo realised that each time I execute my code the results of the t-1 execution is concatenated with the t execution in the output dialog box. I tried to empty my lists empty(list), did not work.

Do I copy paste the script?

Thanks

Re: Baselines
Mathias Mamsch - Wed Oct 13 09:13:41 EDT 2010

izzo - Wed Oct 13 08:54:30 EDT 2010
Hello Mat

1)I tried, but it did not work.. I closed all the none-current modules who were open at the end of the code. But it did not change anything. So I always have the same problem, I need to close the input dialog box.

2) I aslo realised that each time I execute my code the results of the t-1 execution is concatenated with the t execution in the output dialog box. I tried to empty my lists empty(list), did not work.

Do I copy paste the script?

Thanks

better attach it to a post. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Baselines
izzo - Thu Oct 14 04:04:39 EDT 2010

Mathias Mamsch - Wed Oct 13 09:13:41 EDT 2010
better attach it to a post. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Ok I attached it

Thanks
Attachments

attachment_14542383_historique_avec_interface.txt

Re: Baselines
izzo - Fri Oct 15 08:01:30 EDT 2010

izzo - Thu Oct 14 04:04:39 EDT 2010
Ok I attached it

Thanks

No ideas ???? :(

Re: Baselines
Mathias Mamsch - Fri Oct 15 16:21:02 EDT 2010

izzo - Fri Oct 15 08:01:30 EDT 2010
No ideas ???? :(

Ok some general remarks:

  • Your variable names are ... wow. fillist and filllist? really? exittext and exittext? seriously? :-)
  • This code can be bummed (instructions removed):
for obj in skModule do {
        if (find (skBaseline, (key skModule) string), obj2) {
                        // string abso_1= (key skModule) string -> don't need me
                        // obj_v1=object(intOf(abso_1),b1) -> is the same as obj
                        // obj_v2=object(intOf(abso_1),b2) -> is the same as obj2
                        string nameb=name(b1)

 

 

  • Note that the put (skip, key, var) function will put the data in the skip lists only when the key is not already in there. you need to use put (skip, key, var, true) to replace an existing key.

 

 

 

  • Your indentation seems a little messed up. There is a wonderful function "Reindent C++ code" in programmers notepad which will work wonders on your code.


My guess is that, since your skBaselines and skModule, since they are created globally, are filled the first time. When you then choose another baseline and press compare again, the objects of the old baselines are still in the skips. Therefore the find (skBaselines, key) will succeed even though the object does not exists. Then the obj_v1=object(intOf(abso_1),b2) function will return null and the following call like PUID_v2=obj_v2."PUID" will complain about a null object. Therefore the solution should be: insert a setempty before filling the skip lists again.

Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Baselines
izzo - Tue Oct 19 08:57:10 EDT 2010

Thanks mat

Re: Baselines
izzo - Tue Oct 19 10:26:21 EDT 2010

.